<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:datagrid name="departUserList" title="common.operation"
            actionUrl="departController.do?userDatagrid&orgId=${departid}" fit="true" fitColumns="true" idField="id" queryMode="group">
	<t:dgCol title="编号" field="id" hidden="true"></t:dgCol>
	<t:dgCol title="common.username" sortable="false" field="userName" query="true" width="100"></t:dgCol>
	<t:dgCol title="common.real.name" field="realName" query="true" width="100"></t:dgCol>
	<t:dgCol title="common.operation" field="opt" width="100"></t:dgCol>
	<t:dgFunOpt funname="doOwner(id)" title="设为负责人" ></t:dgFunOpt> 
	<t:dgDelOpt title="common.delete" url="departController.do?delDepartUser&id={id}&departid=${departid}"  />
<%-- 	<t:dgToolBar title="common.add.param" langArg="common.user" icon="icon-add" url="userController.do?addorupdate&departid=${departid}" funname="add"></t:dgToolBar>
	<t:dgToolBar title="common.edit.param" langArg="common.user" icon="icon-edit" url="userController.do?addorupdate&departid=${departid}" funname="update"></t:dgToolBar> --%>
	<t:dgToolBar title="添加用户" icon="icon-add" url="departController.do?goAddUserToOrg&orgId=${departid}" funname="add" width="500"></t:dgToolBar>
    <%--update-end--Author:zhangguoming  Date:20140826 for：添加有客户--%>
</t:datagrid>

<script>
	function doOwner(id){
		 $.dialog.confirm('确定要设置为负责人吗?', function(r) {
			   if (r) {
					 
				   $.ajax({
						 url:"departController.do?setOwner&id="+id+"&orgId=${departid}",
						 success:function(data){
							 data = $.parseJSON(data);
							 tip(data.msg) 
						 }
					 });
				   
				}
			}); 
	}
</script>